import React from 'react';
import {Badge} from 'antd';

module.exports = [
    {
        key: 'id',
        title: 'ID',
        dataType: 'int',
        primary: true,
        showType: 'normal',
        showInTable: true,
        showInForm: true,
        disabled: true,
        render: (text, record) => text
    },
    {
        key: 'username',
        title: '用户名',
        dataType: 'varchar',
        validator: [{required: true, message: '此项必填'}]

    },
    {
        key: 'tmpPwd',
        title: '密码',
        dataType: 'varchar',
        showInTable: false,
        validator: [{required: true, message: '此项必填'}]
    },
    {
        key: 'realname',
        title: '真实姓名',
        dataType: 'varchar',
        validator: [{required: true, message: '此项必填'}]

    },
    {
        key: 'roleId',
        title: '角色',
        dataType: 'varchar',
        showInTable: false,
        showType: 'multiSelect',
        optionFormat: "id:name",
        isAsyncData: true,
        url: 'role/select',
       // validator: [{required: true, message: '此项必填'}]

    },
    {
        key: 'status',
        title: '状态',
        dataType: 'int',
        showType: 'select',
        options: [{key: 0, value: "启用"}, {key: 1, value: "禁用"}],
        render: (record) => <Badge status={record === '启用' ? "success" : "error"} text={record}/>
    },
    {
        key: 'createTime',
        title: '创建时间',
        dataType: 'datetime',
        showInForm: false
    }

];